<template>
  <div class="questionnaire-list">
    <a
      v-for="(item, index) in list"
      :key="index"
      @click="enterQuestionDetails(item.id)"
    >
      {{ item.title }}
    </a>
  </div>
</template>

<script>
import { getQuestionList } from "../../../api/home.js";
export default {
  name: "QuestionnaireList",
  components: {},
  data() {
    return {
      list: [],
    };
  },
  created() {
    this.getExamList();
  },
  methods: {
    enterQuestionDetails(id) {
      let routeUrl = this.$router.resolve({
        path:`/wjdc/${id}`,
      });
      window.open(routeUrl.href, "_blank");
    },
    async getExamList() {
      const res = await getQuestionList();
      if (res.status == "200") {
        this.list = res.data;
      }
    },
  },
};
</script>
<style lang="less" scoped>
.questionnaire-list {
  display: flex;
  flex-direction: column;
  a {
    color: #000;
    font-size: 18px;
    line-height: 46px;
    cursor: pointer;
    &:hover {
      color: #999999;
    }
  }
}
</style>
